package com.googlecode.cswish.annotation;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * Formula. To be used as a replacement for @Column in most places
 * mapping one transient column to another actual column
 *
 * @author 
 */
@Target({METHOD, FIELD})
@Retention(RUNTIME)
public @interface QLFormula {
	/**
	 * Support the simple expression, which starts with ':', 
	 * the expression is a static method without parameter of current model
	 * 
	 * @see QLParse.getQLFormulaValue
	 * 
	 * @return
	 */
	String value();
	/**
	 * The type of target column
	 * @return
	 */
	Class type() default String.class;
	
	/**
	 * The mapping property is another column
	 * @return
	 */
	boolean isColumn() default true;
}